home *** CD-ROM | disk | FTP | other *** search
- ; Define addon menu USER menus should go into CMDUSER.CPM...by convention...
- #NextFile CMDUSER.CPM
-
-
- ; CmdPost menu initialization code
-
- ; Initialize a few variables here.
-
- a=Version()
- CP="CmdPost"
- CPDIR=DirHome()
-
- ; *******TO CHANGE TITLES, USE THE Main.ResetOptions command - automagic now!
- TitleFirst=iniread(CP,"TitleFirst","Command Post - Window 1")
- TitleSecond=iniread(CP,"TitleSecond","Command Post - Window 2")
- if !IsLicensed() then TitleFirst="Command Post %a% - Eval Only"
- if !IsLicensed() then TitleSecond ="Command Post %a% # Eval Only"
- crlf=strcat(num2char(13),num2char(10))
- tab=num2char(9)
-
- ; Setting up the View menu item here.
-
- ViewShortLong=iniread(CP,"ViewShortLong","SHORT")
-
- if ViewShortLong=="SHORT" then MenuChange("ViewShort",@CHECK)
- if ViewShortLong=="LONG" then MenuChange("ViewLong",@CHECK)
-
- ViewBy=iniread(CP,"ViewBy","NAME")
- if ViewBy=="NAME" then MenuChange("ViewByName",@CHECK)
- if ViewBy=="DATE" then MenuChange("ViewByDate",@CHECK)
- if ViewBy=="SIZE" then MenuChange("ViewBySize",@CHECK)
- if ViewBy=="KIND" then MenuChange("ViewByKind",@CHECK)
- if ViewBy=="UNSORTED" then MenuChange("ViewUnsorted",@CHECK)
-
- ViewWhat=iniread(CP,"ViewWhat","ALL")
- if ViewWhat=="ALL" then MenuChange("ViewAll",@CHECK)
- if ViewWhat=="PARTIAL" then MenuChange("ViewPartial",@CHECK)
- if ViewWhat=="PROGRAMS" then MenuChange("ViewPrograms",@CHECK)
-
- SD3="*.*"
- if ViewWhat=="PROGRAMS" then SD3="*.EXE *.COM *.BAT *.PIF"
- if ViewWhat=="PARTIAL" then SD3=iniread(CP,"Partial","*.*")
- SetDisplay(ViewShortLong,ViewBy,SD3)
- drop(a,ViewShortLong,ViewBy,ViewWhat,SD3)
-
- ; Setup Print menu item...Kill it if no text printer
- MenuChange("FilePrint", (IniRead(CP,"TextPrinter","")=="NONE") *@DISABLE)
- ; Setup Screen Blank Time. Get time from win.ini
- a=iniread(CP,"BlankTime",5)
- if a!=9999 then run("%CPDIR%cp_blnk.exe",a)
- ; ; <0....blanking with no clock
- ; ; 0... no blanking, but have a clock
- ; ; >0... blanking and clock
- ; ; 9999 Don't even run it.
- ; ; multiple startups ignored.
-
-
- if IsRunning() then goto MORETHANONE ;More than one CP running
- WinTitle("",TitleFirst);Title of first 'Post
- a=IniRead(CP,"WinPosition","0,0,1000,@ABOVEICONS")
- WinPlace(%a%,"")
- Exit
-
- :MORETHANONE
- TitleTemp=TitleSecond
- if !WinExist(TitleFirst) then TitleTemp=TitleFirst
- WinTitle("",TitleTemp) ;Title of this 'Post
- WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
- WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
-
- ;Do not Drop TitleFirst,TitleSecond,crlf,tab,CP as these are used
- ;in following menu items.
- Drop(a,TitleTemp)
-
- ; And the main menu starts.
- &File
- &Run...
- r=CurrentFile()
- if !IsKeyDown(@SHIFT) then r=askline("RUN","Enter file to run",r)
- r=strcat(strtrim(r)," ")
- i=strindex(r," ",0,@FWDSCAN)
- a=strsub(r,1,i-1)
- b=strtrim(strsub(r,i,strlen(r)-i+1))
- run("%a%","%b%")
- drop(a,b,r,i)
- &Load...
- r=CurrentFile()
- if !IsKeyDown(@SHIFT) then l=askline("LOAD","Enter file to load",CurrentFile())
- l=strcat(strtrim(l)," ")
- i=strindex(l," ",0,@FWDSCAN)
- a=strsub(r,1,i-1)
- b=strtrim(strsub(r,i,strlen(r)-i+1))
- runicon("%a%","%b%")
- drop(a,b,i,l)
- Bro&wse...
- l=CurrentFile()
- if !IsKeyDown(@SHIFT) then l=askline("Browse","Enter file to browse",l)
- run("%CPDIR%browser.exe",l)
- drop(a,l)
- &Edit...
- b=FileLocate("winedit.exe")
- if b=="" then b="notepad.exe"
- l=CurrentFile()
- if !IsKeyDown(@SHIFT) then l=askline("Edit","Enter file to edit",l)
- if l=="" || l==" " then goto NULL
- a=strscan(l,".\",0,@BACKSCAN)
- if a==0 then l=strcat(l,".")
- if a==0 then goto NULL
- if strsub(l,a,1)!="." then l=strcat(l,".")
- :NULL
- run(b,l)
- drop(a,b,l)
- &Copy... \ {F8}
- r=OtherDir()
- s=strcat(DirItemize("")," ",FileItemize(""))
- terminate(strlen(s)==1,"Copy Error","No files selected")
- if !IsKeyDown(@SHIFT) then r=askline("Copy",StrCat(s,crlf,crlf,"to"),r)
- terminate(r=="","Copy Error","Cannot copy to null file name")
- q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
- if q==0 then SetDisplay("","","") ;Nope. Set flag to update directory
- FileCopy(s,r,@TRUE)
- OtherUpdate()
- drop(r,s,q)
- &Move/Rename... \ {F7}
- r=OtherDir()
- s=strcat(DirItemize("")," ",FileItemize(""))
- terminate(strlen(s)==1,"Move Error","No files selected")
- if !IsKeyDown(@SHIFT) then r=askline("Move",StrCat(s,crlf,crlf,"to"),r)
- terminate(r=="","Move Error","Cannot move to null file name")
- SetDisplay("","","") ;Set flag to update directory
- FileMove(s,r,@TRUE)
- OtherUpdate()
- drop(r,s)
- &Delete File... \ {DEL}
- f=FileItemize("")
- g=DirItemize("")
- b=0
- if strlen(g)!=0 then b=AskYesNo("!!! Warning !!! ",strcat("Delete files from these directories too?",crlf,g))
- if b!=0 then f=strcat(g," ",f)
- terminate(strlen(f)==0,"delete","No files specified")
- if !IsKeyDown(@SHIFT) then if askyesno("Delete",f)==@NO then exit
- SetDisplay("","","") ;Set flag to update directory
- FileDelete(f)
- OtherUpdate() ; Well if the "other" CmdPost Window points to the
- ; same directory, it *IS* nice...
- drop(f,g,b)
-
- &Print...
- s=FileItemize("")
- terminate(strlen(s)==0,"Print Error","No files selected")
- TextPrinter=iniread(CP,"TextPrinter","ASK")
- if TextPrinter!="ASK" then goto NOASK1
- r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",crlf,"Do you have a standard (NON-Postscript) printer?"))
- if r==@YES then goto ASK1
- iniwrite(CP,"TextPrinter","NONE")
- MenuChange("FilePrint",@DISABLE)
- Exit
- :ASK1
- TextPrinter="NONE|LPT1|LPT2|LPT3"
- TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
- terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
- iniwrite(CP,"TextPrinter",TextPrinter)
- :NOASK1
- Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
- a=AskLine("Print",strcat(s,crlf,crlf,"to"),TextPrinter)
- FileCopy(s,a,@FALSE)
- _&Hilite Files
- a=AskLine("Hilite Files","Enter types of files to hilite",strcat("*.",FileExtension(CurrentFile())))
- FileHilite(a,@TRUE)
- &Unhilite Files
- a=AskLine("Unhilite Files","Enter types of files to unhilite",strcat("*.",FileExtension(CurrentFile())))
- FileHilite(a,@FALSE)
- _&Size of selected files
- message("Total size of files",strcat(FileSize(FileItemize(""))," Bytes"))
-
- &Freespace on Drives
- ; This code initially asks for your last drive
- ; (It does assume you have no holes between C and the
- ; last drive...)
- ; and then computes disk space based on the last drive
-
- NextDrive="C" ;ASSUMES C is your first hard drive.
- TotalSize=0
- DriveReport=""
- LastDrive=iniread(CP,"LastDrive","ASK")
- if LastDrive!="ASK" then goto COUNTSPACE
- LastDrive=AskLine("Setup Question",strcat("Enter letter of last (contiguous) disk drive",crlf,"C D E F G H ...Z"),"C")
- LastDrive=StrUpper(LastDrive)
- iniwrite(CP,"LastDrive",LastDrive)
-
- :COUNTSPACE
- ; Always do C drive
- a=DiskFree(NextDrive)/1024
- TotalSize=a+TotalSize
- DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
- NextDrive=num2char(char2num(NextDrive)+1)
- if NextDrive<=LastDrive then goto COUNTSPACE
-
- ItemSelect("Total Space = %TotalSize%K",DriveReport,"@")
- Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
-
- Space on &A and size of files
- message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
-
-
- Space on &B and size of files
- message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
-
-
- _&Extensions...
- a=strtrim(CurrentFile())
- i=strindex(a,".",0,@FWDSCAN)
- terminate(i==0,"Association Error","Associated files must have an extension")
- b=FileExtension(a)
- c=iniread("extensions",b,"???.EXE ^.%b%")
- d=askline("Associate","%b% files are associated with",c)
- terminate(c==d,"","")
- iniwrite("extensions",b,d)
- _E&xit Windows \ ^X
- EndSession()
-
- &Dir
- Crea&te Directory...
- a=askline("Create Directory","Enter directory to create","")
- terminate(a=="","Create Error","Cannot create directory with null name")
- DirMake(a)
- SetDisplay("","","")
- drop(a)
-
- &Rename Directory...
- a=DirItemize("")
- terminate(ItemCount(a," ")!=1,"Rename Error","Zero or more than one dir specified")
- b=AskLine("Rename Directory","Enter new directory name for %a%",a)
- terminate(a==b || b=="","Rename Error","Illegal name change specified")
- DirRename(a,b)
- SetDisplay("","","")
- OtherUpdate()
- drop(a,b)
-
- &Delete Directory...
- f=DirItemize("")
- terminate(strlen(f)==0,"Delete Directory","No directory specified")
- terminate(@no==askyesno("Delete Directory",f),"Delete Directory","Directory not deleted")
- DirRemove(f)
- SetDisplay("","","")
- OtherUpdate() ; Well if the "other" CmdPost Window points to the
- ; same directory, it *is* nice
- drop(f)
-
- &Change Directory...
- a=DirGet()
- b=strindex(a,':',1,@fwdscan)
- c=askline("Change Directory","Enter directory name",strsub(a,b+1,strlen(a)-b-1))
- terminate(c=="","Directory Error","Directory with null name does not exist")
- DirChange(c)
- SetDisplay("","","")
- drop(a,b,c)
-
- _&Format Diskette...
- ; A wonderful example of variable substitution
- D1="1) 5.25 High Density (1.2M)"
- D2="2) 5.25 Standard (360K)"
- D3="3) 3.5 High Density (1.44M)"
- D4="4) 3.5 Standard (720K)"
- D0="0) None"
- DriveA=iniread(CP,"DriveA","ASK")
- DriveB=iniread(CP,"DriveB","ASK")
- if DriveA!="ASK" & DriveB!="ASK" then goto DOFORMAT
-
- DC="%D1%|%D2%|%D3%|%D4%|%D0%"
- Message("Attention","Command Post needs to learn what kind of floppies %crlf% the system has. Please select accordingly.")
- :ASKA
- a=ItemSelect("Select type of Drive A",DC,"|")
- if a!="" then goto OKDRIVEA
- Message("You MUST select an option for A.","Please retry")
- goto ASKA
- :OKDRIVEA
- DriveA=strsub(a,1,1)
- iniwrite(CP,"DriveA",DriveA)
-
- :ASKB
- a=ItemSelect("Select type of Drive B",DC,"|")
- if a!="" then goto OKDRIVEB
- Message("You MUST select an option for B.","Please retry")
- goto ASKB
- :OKDRIVEB
- DriveB=strsub(a,1,1)
- iniwrite(CP,"DriveB",DriveB)
-
- :DOFORMAT
- A0=""
- A1="1) A: 5.25 HD (1.2M)|2) A: 5.25 DD (360K)"
- A2="2) A: 5.25 DD (360K)"
- A3="3) A: 3.5 HD (1.44M)|4) A: 3.5 Std (720K)"
- A4="4) A: 3.5 Standard (720K)"
- B0=""
- B1="5) B: 5.25 HD (1.2M)|6) B: 5.25 DD (360K)"
- B2="6) B: 5.25 Standard (360K)"
- B3="7) B: 3.5 HD (1.44M)|8) B: 3.5 DD (720K)"
- B4="8) B: 3.5 DD (720K)"
- FF=strcat(A%DriveA%,"|",B%DriveB%)
- drop(A0,A1,A2,A3,A4,B0,B1,B2,B3,B4)
-
- FF=ItemSelect("Choose Format Type Desired",FF,"|")
- terminate(FF=="","Format","No parameters selected")
-
- FF=strsub(FF,1,1) ; FF will be 1 thru 8 (with luck)
- DR=strsub("AB",(FF>4)+1,1) ; DR is desired drive
- FF=FF-((FF>4)*4) ; FF is 1 thru 4
- F11=""
- F12="/4"
- F22=""
- F33=""
- F34="/n:9 /t:80"
- F44=""
- DC=Drive%DR% ; get drive type
- FC=F%DC%%FF%
- FC="%DR%: %FC%"
- DC=strsub(D%FF%,4,strlen(d%FF%)-3)
- Pause("Attention",strcat("Preparing to format %DC%",crlf,"diskette in Drive %DR% with command:",crlf,"FORMAT %FC%"))
- run("command.com","/c format.com %FC%")
- drop(D0,D1,D2,D3,D4,DC,xxx,DriveA,DriveB)
- drop(FF,DR,F11,F12,F22,F33,F34,F44,DC,FC)
-
- _Directory &Tree
- run("%CPDIR%cp_tree.exe","")
-
-
-
- &View
- &Short
- SetDisplay("SHORT","","")
- MenuChange("ViewShort",@CHECK)
- MenuChange("ViewLong",@UNCHECK)
- iniwrite(CP,"ViewShortLong","SHORT")
- &Long
- SetDisplay("LONG","","")
- MenuChange("ViewShort",@UNCHECK)
- MenuChange("ViewLong",@CHECK)
- iniwrite(CP,"ViewShortLong","LONG")
- _&All
- SetDisplay("","","*.*")
- MenuChange("ViewAll",@CHECK)
- MenuChange("ViewPartial",@UNCHECK)
- MenuChange("ViewPrograms",@UNCHECK)
- iniwrite(CP,"ViewWhat","ALL")
- &Partial...
- a=iniread(CP,"Partial","*.*")
- a=AskLine("View Partial","Enter types of files desired",a)
- iniwrite(CP,"Partial",a)
- SetDisplay("","",a)
- MenuChange("ViewAll",@UNCHECK)
- MenuChange("ViewPartial",@CHECK)
- MenuChange("ViewPrograms",@UNCHECK)
- iniwrite(CP,"ViewWhat","PARTIAL")
- P&rograms
- SetDisplay("","","*.EXE *.COM *.BAT *.PIF")
- MenuChange("ViewAll",@UNCHECK)
- MenuChange("ViewPartial",@UNCHECK)
- MenuChange("ViewPrograms",@CHECK)
- iniwrite(CP,"ViewWhat","PROGRAMS")
- _By &Name
- SetDisplay("","NAME","")
- MenuChange("ViewByName",@CHECK)
- MenuChange("ViewByDate",@UNCHECK)
- MenuChange("ViewBySize",@UNCHECK)
- MenuChange("ViewByKind",@UNCHECK)
- MenuChange("ViewUnsorted",@UNCHECK)
- iniwrite(CP,"ViewBy","NAME")
- By &Date
- SetDisplay("","DATE","")
- MenuChange("ViewByName",@UNCHECK)
- MenuChange("ViewByDate",@CHECK)
- MenuChange("ViewBySize",@UNCHECK)
- MenuChange("ViewByKind",@UNCHECK)
- MenuChange("ViewUnsorted",@UNCHECK)
- iniwrite(CP,"ViewBy","DATE")
- By Si&ze
- SetDisplay("","SIZE","")
- MenuChange("ViewByName",@UNCHECK)
- MenuChange("ViewByDate",@UNCHECK)
- MenuChange("ViewBySize",@CHECK)
- MenuChange("ViewByKind",@UNCHECK)
- MenuChange("ViewUnsorted",@UNCHECK)
- iniwrite(CP,"ViewBy","SIZE")
- By &Kind
- SetDisplay("","KIND","")
- MenuChange("ViewByName",@UNCHECK)
- MenuChange("ViewByDate",@UNCHECK)
- MenuChange("ViewBySize",@UNCHECK)
- MenuChange("ViewByKind",@CHECK)
- MenuChange("ViewUnsorted",@UNCHECK)
- iniwrite(CP,"ViewBy","KIND")
- &Unsorted
- SetDisplay("","UNSORTED","")
- MenuChange("ViewByName",@UNCHECK)
- MenuChange("ViewByDate",@UNCHECK)
- MenuChange("ViewBySize",@UNCHECK)
- MenuChange("ViewByKind",@UNCHECK)
- MenuChange("ViewUnsorted",@CHECK)
- iniwrite(CP,"ViewBy","UNSORTED")
-
- |&1 Stack
- winarrange(1)
- &2 Arrange
- winarrange(2)
- &3 Arrange in Rows
- winarrange(3)
- &4 Arrange in Columns
- winarrange(4)
- _&5 (w/o CP) Stack
- winiconize("")
- winarrange(1)
- &6 (w/o CP) Arrange
- winiconize("")
- winarrange(2)
- &7 (w/o CP) Arrange in Rows
- winiconize("")
- winarrange(3)
- &8 (w/o CP) Arrange in Cols
- winiconize("")
- winarrange(4)
- _Change &Wallpaper
- DirChange(FilePath(FileLocate("WIN.INI")))
- a=FileItemize("*.BMP")
- a=strcat("-None- ",a)
- a=ItemSelect("Select New Wallpaper",a," ")
- terminate(a=="","Wallpaper","No wallpaper selected")
- if a=="-None-" then Wallpaper("",0)
- if a=="-None-" then exit
- tile=@FALSE
- if FileSize(a)<40000 then tile=@TRUE
- ;if bmp size less than 40K, assume tile, else center
- Wallpaper(a,tile)
- drop(a,tile)
-
-
- &Main
- &Command Post (2nd Window)
- ErrorMode(@OFF)
- a=WinActivate(TitleFirst)
- b=WinActivate(TitleSecond)
- ErrorMode(@CANCEL)
- if (a&b) then goto PLACETHEM
- DirChange(CPDIR)
- run("cmdpost.exe","")
- drop(a,b)
- Exit
- :PLACETHEM
- WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
- WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
- drop(a,b)
-
-
- Control &Panel
- errormode(@off)
- terminate(winactivate("Control Panel"),"","")
- errormode(@cancel)
- run("control.exe","")
-
- C&lipboard
- errormode(@off)
- terminate(winactivate("Clipboard"),"","") ;Already Running
- errormode(@cancel)
- run("Clipbrd.exe","")
-
- &DOS Prompt
- run(Environment("COMSPEC"),"")
-
- _Get &Help Cardfile
- run("cardfile.exe","%CPDIR%cp_help.crd")
- Get &Question 'n' Answer Cardfile
- run("cardfile.exe","%CPDIR%cp_quest.crd")
-
- Reset &Options...
- :NEXTOPTION
- a="Blanker Options|Window Position|Printer Reset|Floppy Reset|Hard Drive Reset|Window Titles"
- a=ItemSelect("Choose Option to Reset",a,"|")
- if a=="Blanker Options" then goto BLANKER
- if a=="Window Position" then goto POSITION
- if a=="Printer Reset" then goto INFORESET
- if a=="Floppy Reset" then goto INFORESET
- if a=="Hard Drive Reset" then goto INFORESET
- if a=="Window Titles" then goto WINTITLES
- Exit
-
- :BLANKER
- a=iniread(CP,"BlankTime",5)
- b1="Enter screen blanker delay time"
- b2="or 0 to disable blanker"
- b3="or negative time to disable clock"
- b4="or 9999 to eliminate it altogether"
- b1=strcat(b1,crlf,b2,crlf,b3,crlf,b4)
- a=AskLine("Screen Blanker",b1,iniread(CP,"BlankTime",5))
- iniwrite(CP,"BlankTime",a)
- ErrorMode(@OFF)
- WinClose("CmdPost Clock")
- ErrorMode(@CANCEL)
- if a!=9999 then run("%CPDIR%CP_BLNK.EXE",a)
- goto NEXTOPTION
-
- :POSITION
- b1="Do you wish to save the current CmdPost"
- b2="window position for future startups?"
- b1=strcat(b1,crlf,b2)
- a=AskYesNo("CmdPost Window Position",b1)
- if a==@YES then IniWrite(CP,"WinPosition",WinPosition(""))
- goto NEXTOPTION
-
- :INFORESET
- if a!="Printer Reset" then goto INFORESET2
- iniwrite(CP,"TextPrinter","ASK")
- MenuChange("FilePrint",@ENABLE)
- Goto INFORESET9
-
- :INFORESET2
- if a!="Hard Drive Reset" then goto INFORESET3
- iniwrite(CP,"LastDrive","ASK")
- Goto INFORESET9
- :INFORESET3
-
- iniwrite(CP,"DriveA","ASK")
- iniwrite(CP,"DriveB","ASK")
-
- :INFORESET9
- b1="CmdPost's saved information reset."
- b2="You will be prompted to re-enter the"
- b3="necessary information when it is required."
- b1=strcat(b1,crlf,b2,crlf,b3)
- Message("Information Reset",b1)
- goto NEXTOPTION
-
- :WINTITLES
- b1=AskLine("First CmdPost Title","Enter name of main CmdPost window.%crlf%Must be licensed for this to work.",TitleFirst)
- b2=AskLine("Second CmdPost Title","Enter name of other window.%crlf%Must be different!",TitleSecond)
- if (StrIndex(b1,b2,0,@FWDSCAN)+StrIndex(b2,b1,0,@FWDSCAN))==0 then goto TITLEOK
- Message("WinTitle","The two titles MUST be completely different.")
- goto WINTITLES
- :TITLEOK
- iniwrite(CP,"TitleFirst",b1)
- iniwrite(CP,"TitleSecond",b2)
- if WinExist(TitleFirst) then WinTitle(TitleFirst,b1)
- if WinExist(TitleSecond) then WinTitle(TitleSecond,b2)
- TitleFirst=b1
- TitleSecond=b2
- drop(b1,b2,b3)
- goto NEXTOPTION
-
-
- _&System Information
- run("%CPDIR%cp_info.exe","")
-
- |P&rogram Manager
- errormode(@off)
- terminate(winactivate("Program Manager"),"","") ;Already Running
- errormode(@cancel)
- run("Progman.exe","")
-
- &File Manager
- errormode(@off)
- terminate(winactivate("File Manager"),"","") ;Already Running
- errormode(@cancel)
- run("winfile.exe","")
-
- Print &Manager
- run("printman.exe","") ; takes care of itself
-
- &Windows Setup
- a=FilePath(Filelocate("system.ini"))
- run(strcat(a,"setup.exe"),"")
- drop(a)
-
-
- _&Edit CmdPost menus
- DirChange(FilePath(FileLocate("%CPDIR%CMDPOST.CPM")))
- a=FileItemize("*.CPM")
- a=ItemSelect("Select menu to edit",a," ")
- terminate(a=="","Edit","No file selected")
- ;it it already running??? Find it...
- ErrorMode(@OFF)
- terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
- bak=strcat(FileRoot(a),".BAK")
- FileCopy(a,bak,@FALSE)
- run("notepad.exe",a)
- drop(a,bak)
-
- Edit &INI files
- DirChange(FilePath(FileLocate("WIN.INI")))
- a=FileItemize("*.INI")
- a=ItemSelect("Select INI file to edit",a," ")
- terminate(a=="","Edit","No file selected")
- drop(NotWin2,b)
- ;it it already running??? Find it...
- ErrorMode(@OFF)
- terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
- bak=strcat( FileRoot(a),".BAK")
- FileCopy(a,bak,@FALSE);
- run("notepad.exe",a)
- drop(a,bak)
-
- Edit System Confi&guration
- run("sysedit.exe","") ;takes care of itself
-
- PIF Edi&t...
- a=strupper(FileExtension(CurrentFile()))
- if a!="PIF" then goto PIF2
- run("pifedit.exe",CurrentFile())
- exit
- :PIF2
- if IsKeyDown(@SHIFT)==@NO then goto GENERICPIF
- a=FileItemize("*.PIF")
- a=ItemSelect("Choose a PIF File to edit",a," ")
- run("pifedit.exe",a)
- exit
- :GENERICPIF
- DirChange(FilePath(FileLocate("_default.pif")))
- run("pifedit.exe","")
- drop(a,b)
-
-
-
-
-
-